package com.slz3.business.module.memberManagement.memMember.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memMember.domain.MemMember;
import com.slz3.business.module.memberManagement.memMember.domain.MemMemberCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemMemberResController {

    static Mono<ServerResponse> add(ServerRequest req, MemMember memMember) {
        if (MemMemberResUnsafeValid.add(req, memMember)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.add_$MemMemberUpdateLock(req, memMember);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, MemMemberCondition memMemberCondition) {
        if (MemMemberResUnsafeValid.delete(req, memMemberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.delete_$MemMemberUpdateLock(req, memMemberCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, MemMember memMember) {
        if (MemMemberResUnsafeValid.modify(req, memMember)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.modify_$MemMemberUpdateLock(req, memMember);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (MemMemberResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (MemMemberResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.info_$MemMemberUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (MemMemberResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, MemMemberCondition memMemberCondition) {
        //
        if (MemMemberResUnsafeValid.auditSubmit(req, memMemberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.auditSubmit_$MemMemberUpdateLock(req, memMemberCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, MemMemberCondition memMemberCondition) {
        if (MemMemberResUnsafeValid.audit(req, memMemberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.audit_$MemMemberUpdateLock(req, memMemberCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, MemMemberCondition memMemberCondition) {
        if (MemMemberResUnsafeValid.auditReject(req, memMemberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.auditReject_$MemMemberUpdateLock(req, memMemberCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, MemMemberCondition memMemberCondition) {
        if (MemMemberResUnsafeValid.usingEnable(req, memMemberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.usingEnable_$MemMemberUpdateLock(req, memMemberCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, MemMemberCondition memMemberCondition) {
        if (MemMemberResUnsafeValid.usingDisable(req, memMemberCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemMemberResAtomic.usingDisable_$MemMemberUpdateLock(req, memMemberCondition);
        }
    }

}
